home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac: Not for Sale / Another.not.for.sale (Australia).iso / Dr. Doyle / C Lesson / C-LESSON.1 next >
Text File  |  1993-11-01  |  7KB  |  178 lines

  1.  
  2. This archive contains a complete course for you to learn the 'C' computer
  3. language itself.
  4.  
  5. The language used is correct conversational English, I have written the
  6. lessons using the same language constructions which I would use if I were
  7. teaching you directly.
  8.  
  9. An outline of the course is available for you to read below
  10. The course is intended to demonstrate the language
  11. itself and a selection of the simpler standard library functions.
  12.  
  13. I have assumed that you have had sufficient exposure to computing
  14. to be able to use a programmer's editor of your choice and are
  15. confident in the use of the command line interpreter, whether it
  16. be a unix shell, or a DOS ( shudder :-) prompt. Some knowledge,
  17. of computers and the jargon is assumed, but complicated concepts are
  18. fully explained. In other words the intent is to teach 'C' per se,
  19. not 'the fundamentals of how to program a computer using 'C' as
  20. a teaching medium.'
  21.  
  22. 'C' is not a computer language for rank beginners. Start with
  23. an interpretive language and proceed to a compiled language
  24. which has an extensive error message vocabulary and run-time
  25. checking facilities. In the interests of speed of execution 'C'
  26. does very little to protect you from yourself!
  27.  
  28. Throughout the course the fact that a compiler is a translater
  29. from a high level language to assembler code is kept to the fore,
  30. you are frequently advised to examine the assembler code which is
  31. output by the compiler. Some minimal knowledge of computer architecture
  32. is therefore assumed.
  33.  
  34. Whilst I have taken considerable care to ensure that this material is
  35. free of errors I am well aware that to err is a common human failing,
  36. and in this I don't claim to be different from anybody else.
  37. Therefore your gentle critique is welcome together with notification
  38. of any factual errors.
  39.  
  40. It is planned to make the lessons available as a printed book,
  41. complete with a programme diskette if there is sufficient interest.
  42.  
  43.                      Syllabus for the 'C' Language Course.
  44.  
  45.  
  46.     1   a) Historical introduction to the Language.
  47.  
  48.         b) Demonstration of a very simple program.
  49.  
  50.         c) Brief explanation of how the computer turns
  51.            your program text into an executing program.
  52.  
  53.         d) The basic differences between 'C' and other languages.
  54.            The advantages and disadvantages.
  55.  
  56.       We make the assumption that you are able to turn on your machine,
  57.       use the Operating System at the Control Line Interpreter prompt
  58.       "$ ", "c:>" or whatever, and to use an editor to enter program text.
  59.  
  60.  
  61.     2   a) How the 'C' language arranges for the storage of data.
  62.            An explanation of the keywords associated with data.
  63.            The storage classes:- static auto volatile const.
  64.            The variable types:- char int long float double
  65.            The meaning of:- signed unsigned
  66.  
  67.         b) Introduction to the concept of pointers.
  68.  
  69.         c) Explanation of reading from the keyboard and writing to the screen.
  70.            i.e. printf and scanf, the print formatted and scan formatted
  71.                                    functions.
  72.  
  73.         d) The use of arguments to the main() function, argc argv env.
  74.  
  75.         e) A simple program to format text.
  76.  
  77.  
  78.                 3   Structures, arrays and pointers.
  79.  
  80.                           a) Explanation of more coplex data structures.
  81.                           b) Programs which demonstrate uses of pointers.
  82.  
  83.     4   The operators of the language, arithmetic, pointer, logical, bitwise.
  84.  
  85.         a) Precedence.
  86.         b) The unique bit and shifting operators.
  87.            ( for a high level language )
  88.  
  89.     5   a) The Preprocesser.
  90.         b) Header files
  91.  
  92.            What they are and what you put in them, both your own and
  93.            those provided by the 'C' compiler vendor.
  94.  
  95.            A simple title which includes all sorts of things,
  96.            both very useful and a number of traps.
  97.  
  98.     6   The library, why we have them and some of the more useful routines.
  99.  
  100.         a) How to read the book.
  101.         b) The string functions as an example.
  102.  
  103.     7   a) Mistakes and how avoid making them.
  104.         b) Debugging strategies.
  105.         c) The assert macro.
  106.  
  107.     8   a) More on the representation of data vis. struct, typdef.
  108.  
  109.         b) Tables of all sorts.
  110.            Arrays of structures.
  111.            Pre-initialisation of data structures.
  112.            ( Including jump or dispatch tables )
  113.            The bit-field.
  114.  
  115.         c) Use of header files in this.
  116.  
  117.  
  118.     9   a) The control structures of the language, what (not) to use and when.
  119.  
  120.  
  121.    10   a) File IO
  122.  
  123.            This is an enormous subject and we we will
  124.            really only just scratch on the surface.
  125.  
  126.  
  127.    11   a) Lint, and more on errors / bugs and how to avoid them.
  128.  
  129.  
  130.    12  The stack and a quick dip into assembler
  131.  
  132.        a) A study of the function calling mechanism used by most 'C'
  133.           compilers and the effect on compiler output code of using
  134.           the register storage class and the optimiser.
  135.  
  136.    13  The heap.
  137.  
  138.        a) The 'heap', it's management, malloc(), calloc() and free().
  139.  
  140.  
  141.    14  Portability Issues.
  142.  
  143.        a) Defaults for storage sizes.
  144.        b) 'endianism'. Yes, there are big-endian and little-endian computers!
  145.        c) Functions which can be called with a variable number of arguments.
  146.  
  147.  
  148.    15  Sample programs.
  149.  
  150.        Much is to be gained from examining public domain packages
  151.        examining the code and reviewing the author's style.
  152.        We will look at a number of functions and complete packages.
  153.        in particular we will examine a number of sorting functions,
  154.        a multi-threading technique, queues, lists, hashing, and trees.
  155.  
  156.  
  157.                /* ----------------------------------------- */
  158.  
  159. Copyright notice:-
  160.  
  161. (c) 1993 Christopher Sawtell.
  162.  
  163. I assert the right to be known as the author, and owner of the
  164. intellectual property rights of all the files in this material,
  165. except for the quoted examples which have their individual
  166. copyright notices. Permission is granted for onward copying,
  167. but not modification, of this course and its use for personal
  168. study only, provided all the copyright notices are left in the
  169. text and are printed in full on any subsequent paper reproduction.
  170.  
  171. --
  172.  +----------------------------------------------------------------------+
  173.  | NAME   Christopher Sawtell                                           |
  174.  | SMAIL  215 Ollivier's Road, Linwood, Christchurch, 8001. New Zealand.|
  175.  | EMAIL  chris@gerty.equinox.gen.nz                                    |
  176.  | PHONE  +64-3-389-3200   ( gmt +13 - your discretion is requested )   |
  177.  +----------------------------------------------------------------------+
  178.